package org.lds.hotkey.console.business.appinstance.model.request;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;
import org.lds.hotkey.common.model.pojo.request.BaseCreateRequest;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 新建 - 请求
 *
 * @author lidongsheng
 * @since 2024-06-05
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors(chain = true)
public class AppInstanceBaseCreateRequest extends BaseCreateRequest implements Serializable {
    private static final long serialVersionUID = 1L;


    /**
     * app主键
     */
    @NotNull(message = "appId不能为空")
    private Long appId;


    /**
     * IP
     */
    @NotBlank(message = "ip不能为空")
    private String ip;

    public void setIp(String ip) {
        this.ip = StringUtils.trimToNull(ip);
    }

    /**
     * 端口
     */
    @NotNull(message = "port不能为空")
    private Integer port;


}
